/**
 * 
 */
package com.objectdraw.server.data;

/**
 * POJO for storing a canvas action.  More specifically when a keyboard even or mouse event
 * is passed to the server the information related to that event is stored in an Action
 * object
 * @author Harrison
 */
public class Action {
	private String action = "";
	private String event = "";
	private String arguments = "";
	
	@Override
	/**
	 * Returns a string in the form of <tool> <color> <action> <event> <arguments>
	 */
	public String toString(){
		StringBuilder sb = new StringBuilder();
		sb.append(action);
		sb.append(" ");
		sb.append(event);
		sb.append(" ");
		sb.append(arguments);
		return sb.toString();
	}
	
	/**
	 * set the arguements for the action
	 * 
	 * @param arguments
	 */
	public void setArguments(String arguments){
		this.arguments = arguments;
		if(this.arguments == null){
			this.arguments = "";
		}
	}
	/**
	 * 
	 * @return the arguements string
	 */
	public String getArguments(){
		return this.arguments;
	}
	/**
	 * 
	 * @param event set the event for the action
	 */
	public void setEvent(String event){
		this.event = event;
		if(this.event == null){
			this.event = "";
		}
	}
	
	/**
	 * 
	 * @return the event string
	 */
	public String getEvent(){
		return event;
	}
	/**
	 * 
	 * @param action set the action for the action object
	 */
	public void setAction(String action){
		this.action = action;
		if(this.action == null){
			this.action = "";
		}
	}
	/**
	 * 
	 * @return the action string
	 */
	public String getAction(){
		return action;
	}
}
